package org.zanateh.wargame.graphics;

import org.anddev.andengine.entity.IEntity;
import org.anddev.andengine.entity.IEntity.IEntityMatcher;

public class PointHexagonMatcher implements IEntityMatcher {

	private final float mX;
	private final float mY;
	
	public PointHexagonMatcher( float pX, float pY )
	{
		mX = pX;
		mY = pY;
	}
	
	@Override
	public boolean matches(IEntity pEntity) {
		if( HexagonDrawable.class.isInstance(pEntity))
		{
			HexagonDrawable hex = (HexagonDrawable)pEntity;
			return hex.contains(mX, mY);
			
		}
		
		return false;
	}

}
